/*
 *寄生组合式继承
 */

function Father(surname) {
    this.surname = surname;
    this.name = '三';
}

Father.prototype.fullName = function () { return `${this.surname}${this.name}` };

function Son(surname) {
    //第一步
    Father.call(this, surname);
    this.name = '四';
}
//第二步
Son.prototype = Object.create(Father.prototype);
//第三步
Son.prototype.constructor = Son;

var fa = new Father('李');
var son = new Son('张');
console.log(fa.fullName());
console.log(son.fullName());